package com.mxprojects.gui
{
	import com.mxprojects.constructors.Divider;
	import com.mxprojects.constructors.DrawBorder;
	import com.mxprojects.io.Config;
	import com.mxprojects.language.Language;
	import com.mxprojects.language.Word;
	
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class PostHeader extends BaseForumElement
	{
		private const DIVIDER_COUNT:int = 1;
		
		public var author:TextField;
		public var message:TextField;
						
		public function PostHeader(){
			//set the stuff from the CSS if it's there
			author.styleSheet = Styles.css;
			message.styleSheet = Styles.css;
			
			//when this is put on the stage load the language
			author.htmlText = "<span class=\"postHeaderAuthor\">" + Language.main(Word.AUTHOR) + "</span>";
			message.htmlText = "<span class=\"postHeaderMessage\">" + Language.main(Word.MESSAGE) + "</span>";
			
			//handle the defaults
			super.init(".postHeaderBackground", DIVIDER_COUNT);
		}
		
		override public function resize():void {
			placeStuff();
			super.resize();
		}
		
		private function placeStuff():void {			
			//dividers
			getDivider(0).x = Math.round(message.x - (Config.TEXT_PADDING/2));
		}
	}
}